package cn.yh.nft.turbo.base.exception;

/**
 * @ClassName: SystemException
 * @Author: 草莓爱上啵啵
 */
public class SystemException extends RuntimeException{
    private ErrorCode errorCode;

    public SystemException(ErrorCode errorCode){
        super(errorCode.getMessage());
        this.errorCode =errorCode;
    }

    public SystemException(String message, ErrorCode errorCode){
        super(message);
        this.errorCode = errorCode;
    }

    public SystemException(String message, Throwable cause, ErrorCode errorCode){
        super(message, cause);
        this.errorCode = errorCode;
    }

    public SystemException(Throwable cause, ErrorCode errorCode){
        super(cause);
        this.errorCode = errorCode;
    }

    public SystemException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, ErrorCode errorCode){
        super(message, cause, enableSuppression, writableStackTrace);
        this.errorCode = errorCode;
    }

    public ErrorCode getErrorCode(){
        return errorCode;
    }

    public void setErrorCode(ErrorCode errorCode){
        this.errorCode = errorCode;
    }
}
